

#import "QCPrivacyPolicyVC.h"

@interface QCPrivacyPolicyVC (){
    IBOutlet UIButton *_closeBtn;
    IBOutlet UIScrollView *_contianerView;
    IBOutlet UILabel *_textLabel;
}

@end

@implementation QCPrivacyPolicyVC

-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    CGSize size = [_textLabel sizeThatFits:CGSizeMake(CC_SCREEN_WIDTH-30.0f, 10000.0f)];
    _contianerView.contentSize = CGSizeMake(CC_SCREEN_WIDTH, size.height);
    
}


- (void)viewDidLoad {
    [super viewDidLoad];

    [self.view addSubview:_contianerView];
    [_contianerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_closeBtn.mas_bottom).mas_offset(10.0f);
        make.left.right.bottom.mas_equalTo(self.view).mas_offset(0.0f);
    }];
    
    [_textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(CC_SCREEN_WIDTH-30.0f);
    }];

    _textLabel.text = [_textLabel.text stringByReplacingOccurrencesOfString:@"appfork facebook-url" withString:CC_FACEBOOK_HOME_URL];
    _textLabel.text = [_textLabel.text stringByReplacingOccurrencesOfString:@"app_name" withString:kCCFBDisplayName];
}

#pragma mark - user Event
-(IBAction)onClose{
    [self.navigationController popViewControllerAnimated:YES];
}
@end
